<div class="container">
<div style="margin;0px auto;">
<button class="btn btn-primary pull-right" data-toggle="modal" data-target="#myModal">Create Article Properties</button>
</div>
<div style="margin:50px auto;">
    <table class="table  table-condensed table-hover text-center">
        <tr>
            <td>序号</td>
            <td>属性</td>
            <td>说明</td>
            <td>创建时间</td>
            <td>操作</td>
        </tr>
    <?php  foreach($cc as $key=>$value){?>
        <tr id="<?php echo $value->name;?>">
            <td><?php echo $key;?></td>
            <td><?php echo $value->name; ?></td>
            <td><?php echo $value->description; ?></td>
            <td><?php echo $value->createdate; ?></td>
            <td>
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
                    <ul class="dropdown-menu" role="menu">
                    <li><a onclick="update('<?php echo $value->name;?>')" data-toggle="modal" data-target="#myModalupdate">修改</a></li>
                    <li><a onclick="deletes('<?php echo $value->name;?>')" data-toggle="modal" data-target="#myModaldelete">删除</a></li>
                    </ul>
                </div>
            </td>
        </tr>
    <?php }?>
    </table>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Create Article Properties</h4>
      </div>
      <div class="modal-body">
        <div class="row">
            <div class="col-md-10">
      <form id="articleform" action="<?php echo site_url("/adminarticle/add");?>" method="POST">
               <input id="name" class="form-control" name="name" type="text" placeholder="Name">
                <textarea id="description" name="description" placeholder="Description" class="form-control"  cols="20" rows="5"></textarea>
       <div id="error" class="alert-danger"></div>
        </form>
            </div>    
        </div>
      </div>
      <div class="modal-footer">
        <button id="cancel" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button id="articlesubmit" type="submit" class="btn btn-success">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>

<div class="modal fade" id="myModalupdate" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Update Article Properties</h4>
      </div>
      <div class="modal-body">
        <div class="row">
            <div class="col-md-10">
      <form id="articleupdateform" action="<?php echo site_url("/adminarticle/update");?>" method="POST">
                
               <input id="nameupdateold" class="form-control" name="old_name" type="hidden" placeholder="Name">
               <input id="nameupdate" class="form-control" name="name" type="text" placeholder="Name">
                <textarea id="descriptionupdate" name="description" placeholder="Description" class="form-control"  cols="20" rows="5"></textarea>
       <div id="error" class="alert-danger"></div>
        </form>
            </div>    
        </div>
      </div>
      <div class="modal-footer">
        <button id="cancel" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button id="articleupdate" type="submit" class="btn btn-success">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>

<div class="modal fade" id="myModaldelete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Delete Article Properties</h4>
      </div>
      <div class="modal-body">
        <div class="row">
            <div class="col-md-10">
      <form id="articledeleteform" action="<?php echo site_url("/adminarticle/delete");?>" method="POST">
                
               <input id="namedelete" class="form-control" name="name" type="hidden" placeholder="Name">
               <input id="namedeletedisable" class="form-control" name="namedisable" type="text" placeholder="Name" disabled="disabled">
                
                <input id="descriptiondelete" name="description" placeholder="Description" class="form-control"  type="hidden"></input>
                <textarea id="descriptiondeletedis" name="descriptiondisabled" placeholder="Description" class="form-control"  cols="20" rows="5" disabled="disabled"></textarea>
       <div id="error" class="alert-danger"></div>
        </form>
            </div>    
        </div>
      </div>
      <div class="modal-footer">
        <button id="cancel" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button id="articledelete" type="submit" class="btn btn-success">Delete Properties</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>


<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.js"></script>
<script type="text/javascript" src="/static/js/jquery.form.js"></script>
<script type="text/javascript" src="/static/js/footer.js"></script>
</body>
</html>
